package com.yuexun.dhdoctor.module.email.model.impl;


import com.yuexun.dhdoctor.module.email.api.GetApi;
import com.yuexun.dhdoctor.module.email.bean.MailBean;
import com.yuexun.dhdoctor.module.email.model.IGetModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/8/1.
 */
public class GetModel implements IGetModel {
    private GetApi api;

    //记录Log
//    private final Logger log = ProUtil.getLogger(LoginModel.class);

    public GetApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(GetApi.class);
        }
    }

    @Override
    public Observable<MailBean> getmail(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMail(praise);
    }

    @Override
    public Observable<MailBean> getmail_Draft(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMail_Draft(praise);
    }
}
